<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>移动端适配测试 - AuthDialog</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
        }
        
        .header {
            text-align: center;
            color: white;
            margin-bottom: 40px;
        }
        
        .header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        
        .header p {
            font-size: 1.1rem;
            opacity: 0.9;
        }
        
        .test-section {
            background: white;
            border-radius: 16px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }
        
        .test-section h2 {
            color: #333;
            margin-bottom: 20px;
            font-size: 1.5rem;
        }
        
        .test-buttons {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            margin-bottom: 20px;
        }
        
        .test-btn {
            background: linear-gradient(135deg, #ff5a00 0%, #ff0036 100%);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 25px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(255, 90, 0, 0.3);
        }
        
        .test-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 90, 0, 0.4);
        }
        
        .test-btn:active {
            transform: translateY(0);
        }
        
        .device-info {
            background: #f8f9fa;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
        }
        
        .device-info h3 {
            color: #495057;
            margin-bottom: 15px;
            font-size: 1.2rem;
        }
        
        .info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
        }
        
        .info-item {
            background: white;
            padding: 15px;
            border-radius: 8px;
            border-left: 4px solid #007bff;
        }
        
        .info-label {
            font-weight: 600;
            color: #495057;
            margin-bottom: 5px;
        }
        
        .info-value {
            color: #007bff;
            font-family: monospace;
        }
        
        .responsive-test {
            background: #e3f2fd;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
        }
        
        .responsive-test h3 {
            color: #1976d2;
            margin-bottom: 15px;
        }
        
        .breakpoint-indicator {
            display: inline-block;
            padding: 8px 16px;
            background: #1976d2;
            color: white;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.9rem;
        }
        
        .mobile-simulator {
            background: #333;
            border-radius: 20px;
            padding: 20px;
            margin: 20px 0;
            max-width: 375px;
            margin-left: auto;
            margin-right: auto;
        }
        
        .mobile-screen {
            background: white;
            border-radius: 12px;
            padding: 20px;
            min-height: 400px;
            position: relative;
        }
        
        .mobile-header {
            background: #f5f5f5;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
        }
        
        .mobile-content {
            background: #fff;
            border: 2px dashed #ddd;
            border-radius: 8px;
            padding: 20px;
            text-align: center;
            color: #666;
        }
        
        .mobile-content h4 {
            margin-bottom: 10px;
            color: #333;
        }
        
        .mobile-content p {
            font-size: 0.9rem;
            line-height: 1.4;
        }
        
        .features-list {
            background: #f8f9fa;
            border-radius: 12px;
            padding: 20px;
        }
        
        .features-list h3 {
            color: #28a745;
            margin-bottom: 15px;
        }
        
        .feature-item {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            padding: 10px;
            background: white;
            border-radius: 8px;
            border-left: 4px solid #28a745;
        }
        
        .feature-icon {
            width: 24px;
            height: 24px;
            background: #28a745;
            border-radius: 50%;
            margin-right: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 12px;
        }
        
        .feature-text {
            color: #495057;
            font-size: 0.95rem;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                padding: 10px;
            }
            
            .header h1 {
                font-size: 2rem;
            }
            
            .test-section {
                padding: 20px;
            }
            
            .test-buttons {
                flex-direction: column;
            }
            
            .test-btn {
                width: 100%;
            }
            
            .info-grid {
                grid-template-columns: 1fr;
            }
        }
        
        @media (max-width: 480px) {
            .header h1 {
                font-size: 1.8rem;
            }
            
            .test-section {
                padding: 15px;
            }
            
            .mobile-simulator {
                max-width: 100%;
                border-radius: 12px;
            }
        }
        
        /* 触摸设备优化 */
        @media (hover: none) and (pointer: coarse) {
            .test-btn {
                min-height: 44px;
            }
            
            .test-btn:active {
                transform: scale(0.98);
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>🔐 移动端适配测试</h1>
            <p>测试 AuthDialog 组件的移动端响应式效果</p>
        </div>
        
        <div class="test-section">
            <h2>📱 设备信息检测</h2>
            <div class="device-info">
                <h3>当前设备状态</h3>
                <div class="info-grid">
                    <div class="info-item">
                        <div class="info-label">屏幕宽度</div>
                        <div class="info-value" id="screen-width">检测中...</div>
                    </div>
                    <div class="info-item">
                        <div class="info-label">屏幕高度</div>
                        <div class="info-value" id="screen-height">检测中...</div>
                    </div>
                    <div class="info-item">
                        <div class="info-label">设备类型</div>
                        <div class="info-value" id="device-type">检测中...</div>
                    </div>
                    <div class="info-item">
                        <div class="info-label">触摸支持</div>
                        <div class="info-value" id="touch-support">检测中...</div>
                    </div>
                    <div class="info-item">
                        <div class="info-label">方向</div>
                        <div class="info-value" id="orientation">检测中...</div>
                    </div>
                    <div class="info-item">
                        <div class="info-label">像素比</div>
                        <div class="info-value" id="pixel-ratio">检测中...</div>
                    </div>
                </div>
            </div>
            
            <div class="responsive-test">
                <h3>响应式断点检测</h3>
                <div class="breakpoint-indicator" id="breakpoint">检测中...</div>
            </div>
        </div>
        
        <div class="test-section">
            <h2>🧪 功能测试</h2>
            <div class="test-buttons">
                <button class="test-btn" onclick="testResponsive()">测试响应式</button>
                <button class="test-btn" onclick="testTouch()">测试触摸事件</button>
                <button class="test-btn" onclick="testOrientation()">测试方向变化</button>
                <button class="test-btn" onclick="testResize()">测试窗口缩放</button>
            </div>
            
            <div id="test-results"></div>
        </div>
        
        <div class="test-section">
            <h2>📱 移动端模拟器</h2>
            <div class="mobile-simulator">
                <div class="mobile-screen">
                    <div class="mobile-header">
                        <h4>AuthDialog 预览</h4>
                        <small>移动端样式模拟</small>
                    </div>
                    <div class="mobile-content">
                        <h4>🔐 登录/注册</h4>
                        <p>这里将显示 AuthDialog 组件的移动端效果</p>
                        <p>请在实际 Vue 应用中测试完整功能</p>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="test-section">
            <h2>✨ 移动端适配特性</h2>
            <div class="features-list">
                <div class="feature-item">
                    <div class="feature-icon">✓</div>
                    <div class="feature-text">响应式宽度：移动端使用 90vw，桌面端使用 520px</div>
                </div>
                <div class="feature-item">
                    <div class="feature-icon">✓</div>
                    <div class="feature-text">触摸优化：按钮和输入框的触摸反馈效果</div>
                </div>
                <div class="feature-item">
                    <div class="feature-icon">✓</div>
                    <div class="feature-text">尺寸适配：移动端使用 large 尺寸，桌面端使用 default</div>
                </div>
                <div class="feature-item">
                    <div class="feature-icon">✓</div>
                    <div class="feature-text">间距优化：移动端友好的内边距和外边距</div>
                </div>
                <div class="feature-item">
                    <div class="feature-icon">✓</div>
                    <div class="feature-text">横屏适配：针对横屏模式的特殊优化</div>
                </div>
                <div class="feature-item">
                    <div class="feature-icon">✓</div>
                    <div class="feature-text">小屏幕优化：480px 以下屏幕的特殊处理</div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 设备信息检测
        function updateDeviceInfo() {
            document.getElementById('screen-width').textContent = `${window.innerWidth}px`;
            document.getElementById('screen-height').textContent = `${window.innerHeight}px`;
            
            const isMobile = window.innerWidth <= 768;
            const isTablet = window.innerWidth > 768 && window.innerWidth <= 992;
            const isDesktop = window.innerWidth > 992;
            
            let deviceType = '桌面端';
            if (isMobile) deviceType = '移动端';
            else if (isTablet) deviceType = '平板端';
            
            document.getElementById('device-type').textContent = deviceType;
            
            const touchSupport = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
            document.getElementById('touch-support').textContent = touchSupport ? '支持' : '不支持';
            
            const orientation = window.innerWidth > window.innerHeight ? '横屏' : '竖屏';
            document.getElementById('orientation').textContent = orientation;
            
            document.getElementById('pixel-ratio').textContent = window.devicePixelRatio.toFixed(2);
            
            // 更新断点指示器
            let breakpoint = 'xl';
            if (window.innerWidth <= 480) breakpoint = 'xs';
            else if (window.innerWidth <= 768) breakpoint = 'sm';
            else if (window.innerWidth <= 992) breakpoint = 'md';
            else if (window.innerWidth <= 1200) breakpoint = 'lg';
            
            document.getElementById('breakpoint').textContent = `当前断点: ${breakpoint.toUpperCase()}`;
        }
        
        // 测试响应式
        function testResponsive() {
            showTestResult('响应式测试', '✅ 响应式检测正常，设备信息已更新');
        }
        
        // 测试触摸事件
        function testTouch() {
            const touchSupport = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
            if (touchSupport) {
                showTestResult('触摸事件测试', '✅ 触摸设备检测正常，触摸优化已启用');
            } else {
                showTestResult('触摸事件测试', '⚠️ 非触摸设备，触摸优化未启用');
            }
        }
        
        // 测试方向变化
        function testOrientation() {
            const orientation = window.innerWidth > window.innerHeight ? '横屏' : '竖屏';
            showTestResult('方向测试', `✅ 当前方向: ${orientation}`);
        }
        
        // 测试窗口缩放
        function testResize() {
            showTestResult('窗口缩放测试', '✅ 窗口尺寸变化监听已启用');
        }
        
        // 显示测试结果
        function showTestResult(title, message) {
            const resultsDiv = document.getElementById('test-results');
            const resultItem = document.createElement('div');
            resultItem.style.cssText = `
                background: #d4edda;
                border: 1px solid #c3e6cb;
                color: #155724;
                padding: 15px;
                border-radius: 8px;
                margin-top: 15px;
            `;
            resultItem.innerHTML = `<strong>${title}:</strong> ${message}`;
            resultsDiv.appendChild(resultItem);
            
            // 3秒后自动移除
            setTimeout(() => {
                resultItem.remove();
            }, 3000);
        }
        
        // 监听窗口变化
        window.addEventListener('resize', updateDeviceInfo);
        window.addEventListener('orientationchange', () => {
            setTimeout(updateDeviceInfo, 100);
        });
        
        // 页面加载时初始化
        window.addEventListener('load', updateDeviceInfo);
        
        // 定期更新设备信息
        setInterval(updateDeviceInfo, 1000);
    </script>
</body>
</html>
